import request from '@/utils/request'

/**
 * ROI列表查询
 * @param {*} data
 */
export function queryPageListAPI(data) {
  return request({
    url: '/crmRoiPutin/queryPageList',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 查询渠道列表
 * @param {*} data
 */
export function querySourceAPI(data) {
  return request({
    url: '/crmPutinMoney/querySource',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * ROI统计列表--集团总统计
 * @param {*} data
 */
export function queryAllRoiStatisAPI(data) {
  return request({
    url: '/crmRoiStatis/queryAllRoiStatis',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * ROI消耗查看明细
 * @param {*} data
 */
export function getRoiDataByIdAPI(data) {
  return request({
    url: '/crmRoiPutin/getRoiDataById',
    method: 'get',
    params: data,
  })
}

/**
 * ROI消耗查看操作记录
 * @param {*} data
 */
export function queryRecordListAPI(data) {
  return request({
    url: '/crmActionRecord/queryRecordList',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded'
    }
  })
}

/**
 * 新建消耗
 * @param {*} data
 */
export function addAPI(data) {
  return request({
    url: '/crmRoiPutin/add',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 更新消耗
 * @param {*} data
 */
export function updateAPI(data) {
  return request({
    url: '/crmRoiPutin/update',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * ROI统计明细
 * @param {*} data
 */
export function roiDetailBySourceAPI(data) {
  return request({
    url: '/crmRoiStatis/roiDetailBySource',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * ROI统计-月度统计
 * @param {*} data
 */
export function roiStatisForMonthAPI(data) {
  return request({
    url: '/crmRoiStatis/roiStatisForMonth',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * ROI统计-年度统计
 * @param {*} data
 */
export function roiStatisForYearAPI(data) {
  return request({
    url: '/crmRoiStatis/roiStatisForYear',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * ROI预收益统计
 * @param {*} data
 */
export function projectedRevenueStatisAPI(data) {
  return request({
    url: '/crmRoiStatis/projectedRevenueStatis',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

/**
 * 客单价年度统计
 * @param {*} data
 */
export function priceStatisForYearAPI(data) {
  return request({
    url: '/crmRoiStatis/priceStatisForYear',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}

// 
/**
 * 客单价月度统计
 * @param {*} data
 */
export function priceStatisForMonthAPI(data) {
  return request({
    url: '/crmRoiStatis/priceStatisForMonth',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    }
  })
}